# 数据地址
prometheus_data_dir="/leaper/base_service/prometheus/data"
prometheus_repos_dir="/leaper/base_service/prometheus/repos/prometheus_repo"

# 新建Grafana存储地址
mkdir -p ${prometheus_data_dir}/grafana/grafana-storage

# 赋予权限
chmod 777 -R ${prometheus_data_dir}/grafana/grafana-storage

# 删除老版本容器
prometheus_pre_repos_dir=${prometheus_repos_dir}/$(ls $prometheus_repos_dir | sort -n | head -n 1)
docker compose -f $prometheus_pre_repos_dir/docker-compose.yml stop
docker compose -f $prometheus_pre_repos_dir/docker-compose.yml rm -f

# 启动新版本容器
docker compose up -d
